package com.haiyou.data.game.role;

import java.util.Map;

import com.google.common.collect.Maps;
import com.haiyou.common.entity.Entity;
import com.haiyou.common.jdbc.DbType;
import com.haiyou.data.common.cache.redis.redisson.annotation.RDatabase;
import com.haiyou.data.common.persister.mysql.annotation.Comment;
import com.haiyou.data.common.persister.mysql.annotation.Database;
import com.haiyou.data.common.persister.mysql.annotation.Id;
import com.haiyou.data.common.persister.mysql.annotation.Length;
import com.haiyou.data.common.persister.mysql.annotation.Table;
import com.haiyou.data.common.persister.mysql.annotation.Text;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;

/**
 * 
 * 玩家账号角色信息
 * @author xingyuan
 * @Date 2023年6月26日 上午9:48:53
 */
@NoArgsConstructor
@AllArgsConstructor
@ToString
@Getter
@Setter
@Database(alias = DbType.GAME_DB)
@RDatabase(alias = DbType.GAME_DB)
@Table(name = "t_u_player_account_role")
public class PlayerRoleTable implements Entity<String>{

	private static final long serialVersionUID = 735600223197696686L;
	
	@Id
	@Comment("数据 id")
	private String id;
	
	/**
	 * 玩家 账号系统id
	 */
	@Length(value = Length.Len.TINY)
	@Comment("sdk账号系统uid")
	private String uid;
	
	/**
	 * 玩家角色信息
	 */
	@Text
	@Comment("账号系统对应 key 服务器id,value 玩家ID")
	private Map<Integer,Long> roles = Maps.newHashMap();
	
	@Comment("上次登录服务器id")
	private int lastLoginServerId;
}
